/**
 * @file testsim.h
 * @author 范文宇 (2643660853@qq.com)
 * @brief
 * @version 1.0
 * @date 2023-09-24
 *
 * @copyright Copyright (c) 2023
 *
 */

#include <ros/ros.h>
#include <tf/transform_broadcaster.h>
#include <gazebo_msgs/LinkStates.h>
#include <gazebo_msgs/ModelState.h>
#include <nav_msgs/Odometry.h>

class GazeboSim
{
    ros::NodeHandle nh;              // 句柄
    ros::Subscriber link_states_sub; // 订阅 /gazebo/link_states
    ros::Publisher odom_pub;
    ros::Publisher model_state_pub;
    nav_msgs::Odometry odom_data;
    tf::TransformBroadcaster tfBroadcaster;
    tf::StampedTransform odomTrans;
    gazebo_msgs::LinkStates linkstate_data;

    gazebo_msgs::ModelState cameraState;
    gazebo_msgs::ModelState lidarState;
    gazebo_msgs::ModelState robotState;

public:
    GazeboSim();
    ~GazeboSim() = default;
    void linkStatesCallBack(const gazebo_msgs::LinkStatesConstPtr &msg);
};
